<pre><?php

/* contert.php -- converts data.ini files from pre-joleblog-0.7 to the updated 0.8 format. */

// load in a data file
$data = parse_ini_file('data.ini', true);
// does this work?
if (isset($data) == 0) { echo "Your data.ini file is not accessible!"; exit; }

// count them up
$number_of_entries = count($data);
krsort($data);

// allows for sequential access as well as random access

$n=0;
foreach($data as $unix_time => $array) {
		$numbered[$n] = $array;
		$numbered[$n]['id'] = $unix_time;
		$n++;		
}

$total = count($data);

	for ($i=0; $i<$total; $i++) {

		echo '[' . $numbered[$i]['id'] . ']' . "\n";
		echo 'title="' . $numbered[$i]['title'] . '"' . "\n\n";
		/*
		
		echo '<p>' . "\n";
		$numbered[$i]['content'] = preg_replace( "@&quot;(.*)&quot;:(http://|ftp://)([^ ]*)@", '<a href="$2$3">$1</a>', $numbered[$i]['content']);
		echo $numbered[$i]['content'] . "\n";
		echo '</p>' . "\n";

		echo '<span style="font-size:90%;">';
		echo date('l\, F dS Y h:i A', $numbered[$i]['id']);
		echo '</span>';
		echo "\n\n";
		*/
	}
	
	
?></pre>	